Imports DotNetNuke
Imports System.Web.UI

Namespace YourCompany.Modules.TwitterDNN

       Partial Class Settings
        Inherits Entities.Modules.ModuleSettingsBase

        Public Overrides Sub LoadSettings()
            Try
                If (Page.IsPostBack = False) Then
                    If CType(TabModuleSettings("yourname"), String) <> "" Then
                        txtYourName.Text = CType(TabModuleSettings("yourname"), String)
                    End If
                    If CType(TabModuleSettings("numtweets"), String) <> "" Then
                        txtNumTweets.Text = CType(TabModuleSettings("numtweets"), String)
                    End If
                    If CType(TabModuleSettings("linktweet"), String) <> "" Then
                        txtLinkTweet.Text = CType(TabModuleSettings("linktweet"), String)
                    End If
                    If CType(TabModuleSettings("failwhale"), String) <> "" Then
                        txtFailWhale.Text = CType(TabModuleSettings("failwhale"), String)
                    End If


                End If
            Catch exc As Exception           'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub
        Public Overrides Sub UpdateSettings()
            Try
                Dim objModules As New Entities.Modules.ModuleController

                objModules.UpdateTabModuleSetting(TabModuleId, "yourname", txtYourName.Text)
                objModules.UpdateTabModuleSetting(TabModuleId, "numtweets", txtNumTweets.Text)
                objModules.UpdateTabModuleSetting(TabModuleId, "linktweet", txtLinkTweet.Text)
                objModules.UpdateTabModuleSetting(TabModuleId, "failwhale", txtFailWhale.Text)

                ' refresh cache
                SynchronizeModule()
            Catch exc As Exception           'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub


    End Class

End Namespace

